package security.Roles;
import java.util.*;
public abstract class User {
		
	public abstract Vector<Group> getUserGroups();
		
	public abstract void setUserGroups(Vector<Group> userGroups);
	
	public abstract void addUserGroup(Group g);
	
	public abstract String getUserName();
	
	public abstract void setUserName(String userName) ;
	
	public abstract Vector<Privilege> getUserPrivilege();
	
	public abstract void setUserPrivilege(Vector<Privilege> userPrivilege);
	
	public abstract void addUserPrivilege(Privilege p);
	
	public abstract Vector<Role> getUserRoles();
	
	public abstract void setUserRoles(Vector<Role> userRoles);
	
	public abstract void addUserRole(Role userRole);
	
	public abstract void delUserRole(Role userRole);
	
	public abstract AuthenticationToken getUserToken();
	
	public abstract void setUserToken(AuthenticationToken userToken);
	
//	 STATIC METHODS
	// MUST BE OVERWRITTEN BY SUBCLASSES

	public static boolean addUser(User user) {		
		throwError();
		return false;
	}
	public static boolean saveUser(User user) {
		throwError();
		return false;
	}
	public static boolean delUser(User user) {
		throwError();
		return false;
	}
	public static Vector<User> getUsers() {
		throwError();
		return null;
	}
	public static User getUserByName(String userName) {
		throwError();
		return null;
	}
	private static void throwError() {
		throw new RuntimeException("Error: use a subclass of User to call this method");
	}

}
